<%--
  Created by IntelliJ IDEA.
  User: Gaara_XHG
  Date: 2020/10/8
  Time: 4:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<div class="row">
    <div class="col-md-5" style="float: right;">
        <form class="bs-example bs-example-form" role="form">
            <div class="input-group">
                <input type="text" id='carsearch' class="form-control"  placeholder="请输入" value="${search}">
                <span class="input-group-btn">
                            <button type="button" id="searchCarAll" class="btn btn-primary">
                                <span class="glyphicon glyphicon-search"></span>&nbsp搜索
                            </button>
                            </span>
            </div>
        </form>
    </div>


</div>
<div class="row" style="margin-top: 10px;">
    <div class="col-md-6">
        <button id="refresh" type="button" class="btn btn-primary btn-sm">
            <span class="glyphicon glyphicon-refresh"></span>刷新
        </button>
        <button id="moredelseller"  type="button" class="btn btn-danger btn-sm">
            <span class=" glyphicon glyphicon-trash"></span>批量删除
        </button>

    </div>
</div>
<div class="tab-pane fade in active" >
    <table class="table table-hover table-responsive">

        <thead>
        <tr>
            <th><input id="ck_all_seller" type="checkbox"></th>
            <th>车辆id</th>
            <th>车品牌id</th>
            <th>车系id</th>
            <th>车封面</th>
            <th>车龄</th>
            <th>售价</th>
            <th>底价</th>
<%--            <th>基本描述</th>--%>
            <th>车辆状态</th>
            <th>创建时间</th>
            <th>里程</th>
            <th>座位</th>
            <th>油耗</th>
            <th>用途</th>
            <th>档位</th>
            <th>驱动</th>
            <th>排放</th>
<%--            <th>保险时间</th>--%>
<%--            <th>上牌时间</th>--%>
            <th>检测描述</th>
            <th>车牌号</th>
<%--            <th>点击数</th>--%>
            <th>销售id</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${page.list}" var="p" varStatus="vs">
            <tr>
                <th><input value="${p.id}" name="ck_content_seller" type="checkbox"></th>
                <th >${p.id}</th>
                <th ondblclick='update_carDetailuname(this,${p.id})'>${p.brId}</th>
                <th ondblclick='update_carDetailstId(this,${p.id})'>${p.stId}</th>
                <th ondblclick='update_carDetailcPhoto(this,${p.id})'><img src="${p.CPhoto}" alt="" style="width: 40px;height: 40px"></th>
                <th ondblclick='update_carDetailcAge(this,${p.id})'>${p.CAge}</th>
                <th ondblclick='update_carDetailcOprice(this,${p.id})'>${p.COprice}</th>
                <th ondblclick='update_carDetailcPrice(this,${p.id})'>${p.CPrice}</th>
<%--                <th ondblclick='update_carDetailcDesc(this,${p.id})'>${p.carDesc}</th>--%>
                <th ondblclick='update_carDetailcStatus(this,${p.id})'>${p.CStatus}</th>
                <th ondblclick='update_carDetailcCreatedate(this,${p.id})'>${p.CCreatedate}</th>
                <th ondblclick='update_carDetailcMileage(this,${p.id})'>${p.CMileage}</th>
                <th ondblclick='update_carDetailcSeat(this,${p.id})'>${p.CSeat}</th>
                <th ondblclick='update_carDetailcCus(this,${p.id})'>${p.CCus}</th>
                <th ondblclick='update_carDetailcUse(this,${p.id})'>${p.CUse}</th>
                <th ondblclick='update_carDetailcGear(this,${p.id})'>${p.CGear}</th>
                <th ondblclick='update_carDetailcDrive(this,${p.id})'>${p.CDrive}</th>
                <th ondblclick='update_carDetailcPaifang(this,${p.id})'>${p.CPaifang}</th>
<%--                <th ondblclick='update_carDetailcInsure(this,${p.id})'>${p.carInsure}</th>--%>
<%--                <th ondblclick='update_carDetailcRegistration(this,${p.id})'>${p.carRegistration}</th>--%>
                <th ondblclick='update_carDetailcCheak(this,${p.id})'>${p.CCheak}</th>
                <th ondblclick='update_carDetailcarCarnumber(this,${p.id})'>${p.carCarnumber}</th>
<%--                <th ondblclick='update_carDetailcarCount(this,${p.id})'>${p.carCount}</th>--%>
                <th ondblclick='update_carDetailsalId(this,${p.id})'>${p.salId}</th>

                <td>
                    <a onclick='delCar(this,${p.id})' class="text-danger" href="#"><span class="glyphicon glyphicon-trash"></span></a>
                        <%--                    <a class="text-warning" href="#"><span class="glyphicon glyphicon-edit"></span></a>--%>
                </td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
</div>
<script src="<%=request.getContextPath()%>/js/jquery-3.4.1.js"></script>
<script src="<%=request.getContextPath()%>/plugins/jquery/jquery.min.js"></script>
<script src="<%=request.getContextPath()%>/plugins/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
<script src="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script src="https://cdn.staticfile.org/echarts/4.3.0/echarts.min.js"></script>

<script>
    //异步刷新
    $("#refresh").click(function () {
        $("#showDescCar").load("/prj/admin/showDescCar.action");
        // $("#showDescCar").load("/prj/admin/showDescCar.action",{});
    })
    //全局搜索
    $("#searchCarAll").click(function () {
        let search = $("#carsearch").val();
        $("#showDescCar").load("/prj/admin/showDescCar.action",{search:search});
    })

    //异步删除
    function delCar(obj,id){
        $.post('/prj/admin/delCarDetail.action',{"id":id},function(data){
            if(data.code=="200"){
                let tr = obj.parentElement.parentElement;
                $(tr).remove();
            }
        })
    }

</script>
<%@include file="../page/newCarPage.jsp" %>
